/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/**
 * Autogenerated by Thrift Compiler (0.11.0)
 *
 * <p>DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *
 * @generated
 */
package org.apache.pegasus.apps;

import org.apache.pegasus.base.blob;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(
    value = "Autogenerated by Thrift Compiler (0.11.0)",
    date = "2021-10-15")
public class get_scanner_request
    implements org.apache.thrift.TBase<get_scanner_request, get_scanner_request._Fields>,
        java.io.Serializable,
        Cloneable,
        Comparable<get_scanner_request> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC =
      new org.apache.thrift.protocol.TStruct("get_scanner_request");

  private static final org.apache.thrift.protocol.TField START_KEY_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "start_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1);
  private static final org.apache.thrift.protocol.TField STOP_KEY_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "stop_key", org.apache.thrift.protocol.TType.STRUCT, (short) 2);
  private static final org.apache.thrift.protocol.TField START_INCLUSIVE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "start_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 3);
  private static final org.apache.thrift.protocol.TField STOP_INCLUSIVE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "stop_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 4);
  private static final org.apache.thrift.protocol.TField BATCH_SIZE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "batch_size", org.apache.thrift.protocol.TType.I32, (short) 5);
  private static final org.apache.thrift.protocol.TField NO_VALUE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "no_value", org.apache.thrift.protocol.TType.BOOL, (short) 6);
  private static final org.apache.thrift.protocol.TField HASH_KEY_FILTER_TYPE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "hash_key_filter_type", org.apache.thrift.protocol.TType.I32, (short) 7);
  private static final org.apache.thrift.protocol.TField HASH_KEY_FILTER_PATTERN_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "hash_key_filter_pattern", org.apache.thrift.protocol.TType.STRUCT, (short) 8);
  private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_TYPE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "sort_key_filter_type", org.apache.thrift.protocol.TType.I32, (short) 9);
  private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_PATTERN_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "sort_key_filter_pattern", org.apache.thrift.protocol.TType.STRUCT, (short) 10);
  private static final org.apache.thrift.protocol.TField NEED_CHECK_HASH_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "need_check_hash", org.apache.thrift.protocol.TType.BOOL, (short) 11);
  private static final org.apache.thrift.protocol.TField RETURN_EXPIRE_TS_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "return_expire_ts", org.apache.thrift.protocol.TType.BOOL, (short) 12);
  private static final org.apache.thrift.protocol.TField FULL_SCAN_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "full_scan", org.apache.thrift.protocol.TType.BOOL, (short) 13);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
      new get_scanner_requestStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
      new get_scanner_requestTupleSchemeFactory();

  public blob start_key; // required
  public blob stop_key; // required
  public boolean start_inclusive; // required
  public boolean stop_inclusive; // required
  public int batch_size; // required
  public boolean no_value; // required
  /** @see filter_type */
  public filter_type hash_key_filter_type; // required

  public blob hash_key_filter_pattern; // required
  /** @see filter_type */
  public filter_type sort_key_filter_type; // required

  public blob sort_key_filter_pattern; // required
  public boolean need_check_hash; // optional
  public boolean return_expire_ts; // optional
  public boolean full_scan; // optional

  /**
   * The set of fields this struct contains, along with convenience methods for finding and
   * manipulating them.
   */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    START_KEY((short) 1, "start_key"),
    STOP_KEY((short) 2, "stop_key"),
    START_INCLUSIVE((short) 3, "start_inclusive"),
    STOP_INCLUSIVE((short) 4, "stop_inclusive"),
    BATCH_SIZE((short) 5, "batch_size"),
    NO_VALUE((short) 6, "no_value"),
    /** @see filter_type */
    HASH_KEY_FILTER_TYPE((short) 7, "hash_key_filter_type"),
    HASH_KEY_FILTER_PATTERN((short) 8, "hash_key_filter_pattern"),
    /** @see filter_type */
    SORT_KEY_FILTER_TYPE((short) 9, "sort_key_filter_type"),
    SORT_KEY_FILTER_PATTERN((short) 10, "sort_key_filter_pattern"),
    NEED_CHECK_HASH((short) 11, "need_check_hash"),
    RETURN_EXPIRE_TS((short) 12, "return_expire_ts"),
    FULL_SCAN((short) 13, "full_scan");

    private static final java.util.Map<java.lang.String, _Fields> byName =
        new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /** Find the _Fields constant that matches fieldId, or null if its not found. */
    public static _Fields findByThriftId(int fieldId) {
      switch (fieldId) {
        case 1: // START_KEY
          return START_KEY;
        case 2: // STOP_KEY
          return STOP_KEY;
        case 3: // START_INCLUSIVE
          return START_INCLUSIVE;
        case 4: // STOP_INCLUSIVE
          return STOP_INCLUSIVE;
        case 5: // BATCH_SIZE
          return BATCH_SIZE;
        case 6: // NO_VALUE
          return NO_VALUE;
        case 7: // HASH_KEY_FILTER_TYPE
          return HASH_KEY_FILTER_TYPE;
        case 8: // HASH_KEY_FILTER_PATTERN
          return HASH_KEY_FILTER_PATTERN;
        case 9: // SORT_KEY_FILTER_TYPE
          return SORT_KEY_FILTER_TYPE;
        case 10: // SORT_KEY_FILTER_PATTERN
          return SORT_KEY_FILTER_PATTERN;
        case 11: // NEED_CHECK_HASH
          return NEED_CHECK_HASH;
        case 12: // RETURN_EXPIRE_TS
          return RETURN_EXPIRE_TS;
        case 13: // FULL_SCAN
          return FULL_SCAN;
        default:
          return null;
      }
    }

    /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null)
        throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /** Find the _Fields constant that matches name, or null if its not found. */
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __START_INCLUSIVE_ISSET_ID = 0;
  private static final int __STOP_INCLUSIVE_ISSET_ID = 1;
  private static final int __BATCH_SIZE_ISSET_ID = 2;
  private static final int __NO_VALUE_ISSET_ID = 3;
  private static final int __NEED_CHECK_HASH_ISSET_ID = 4;
  private static final int __RETURN_EXPIRE_TS_ISSET_ID = 5;
  private static final int __FULL_SCAN_ISSET_ID = 6;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {
    _Fields.NEED_CHECK_HASH, _Fields.RETURN_EXPIRE_TS, _Fields.FULL_SCAN
  };
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;

  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap =
        new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(
        _Fields.START_KEY,
        new org.apache.thrift.meta_data.FieldMetaData(
            "start_key",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.STOP_KEY,
        new org.apache.thrift.meta_data.FieldMetaData(
            "stop_key",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.START_INCLUSIVE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "start_inclusive",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.STOP_INCLUSIVE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "stop_inclusive",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.BATCH_SIZE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "batch_size",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(
        _Fields.NO_VALUE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "no_value",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.HASH_KEY_FILTER_TYPE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "hash_key_filter_type",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.EnumMetaData(
                org.apache.thrift.protocol.TType.ENUM, filter_type.class)));
    tmpMap.put(
        _Fields.HASH_KEY_FILTER_PATTERN,
        new org.apache.thrift.meta_data.FieldMetaData(
            "hash_key_filter_pattern",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.SORT_KEY_FILTER_TYPE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "sort_key_filter_type",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.EnumMetaData(
                org.apache.thrift.protocol.TType.ENUM, filter_type.class)));
    tmpMap.put(
        _Fields.SORT_KEY_FILTER_PATTERN,
        new org.apache.thrift.meta_data.FieldMetaData(
            "sort_key_filter_pattern",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.NEED_CHECK_HASH,
        new org.apache.thrift.meta_data.FieldMetaData(
            "need_check_hash",
            org.apache.thrift.TFieldRequirementType.OPTIONAL,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.RETURN_EXPIRE_TS,
        new org.apache.thrift.meta_data.FieldMetaData(
            "return_expire_ts",
            org.apache.thrift.TFieldRequirementType.OPTIONAL,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.FULL_SCAN,
        new org.apache.thrift.meta_data.FieldMetaData(
            "full_scan",
            org.apache.thrift.TFieldRequirementType.OPTIONAL,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(
        get_scanner_request.class, metaDataMap);
  }

  public get_scanner_request() {}

  public get_scanner_request(
      blob start_key,
      blob stop_key,
      boolean start_inclusive,
      boolean stop_inclusive,
      int batch_size,
      boolean no_value,
      filter_type hash_key_filter_type,
      blob hash_key_filter_pattern,
      filter_type sort_key_filter_type,
      blob sort_key_filter_pattern) {
    this();
    this.start_key = start_key;
    this.stop_key = stop_key;
    this.start_inclusive = start_inclusive;
    setStart_inclusiveIsSet(true);
    this.stop_inclusive = stop_inclusive;
    setStop_inclusiveIsSet(true);
    this.batch_size = batch_size;
    setBatch_sizeIsSet(true);
    this.no_value = no_value;
    setNo_valueIsSet(true);
    this.hash_key_filter_type = hash_key_filter_type;
    this.hash_key_filter_pattern = hash_key_filter_pattern;
    this.sort_key_filter_type = sort_key_filter_type;
    this.sort_key_filter_pattern = sort_key_filter_pattern;
  }

  /** Performs a deep copy on <i>other</i>. */
  public get_scanner_request(get_scanner_request other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetStart_key()) {
      this.start_key = new blob(other.start_key);
    }
    if (other.isSetStop_key()) {
      this.stop_key = new blob(other.stop_key);
    }
    this.start_inclusive = other.start_inclusive;
    this.stop_inclusive = other.stop_inclusive;
    this.batch_size = other.batch_size;
    this.no_value = other.no_value;
    if (other.isSetHash_key_filter_type()) {
      this.hash_key_filter_type = other.hash_key_filter_type;
    }
    if (other.isSetHash_key_filter_pattern()) {
      this.hash_key_filter_pattern = new blob(other.hash_key_filter_pattern);
    }
    if (other.isSetSort_key_filter_type()) {
      this.sort_key_filter_type = other.sort_key_filter_type;
    }
    if (other.isSetSort_key_filter_pattern()) {
      this.sort_key_filter_pattern = new blob(other.sort_key_filter_pattern);
    }
    this.need_check_hash = other.need_check_hash;
    this.return_expire_ts = other.return_expire_ts;
    this.full_scan = other.full_scan;
  }

  public get_scanner_request deepCopy() {
    return new get_scanner_request(this);
  }

  @Override
  public void clear() {
    this.start_key = null;
    this.stop_key = null;
    setStart_inclusiveIsSet(false);
    this.start_inclusive = false;
    setStop_inclusiveIsSet(false);
    this.stop_inclusive = false;
    setBatch_sizeIsSet(false);
    this.batch_size = 0;
    setNo_valueIsSet(false);
    this.no_value = false;
    this.hash_key_filter_type = null;
    this.hash_key_filter_pattern = null;
    this.sort_key_filter_type = null;
    this.sort_key_filter_pattern = null;
    setNeed_check_hashIsSet(false);
    this.need_check_hash = false;
    setReturn_expire_tsIsSet(false);
    this.return_expire_ts = false;
    setFull_scanIsSet(false);
    this.full_scan = false;
  }

  public blob getStart_key() {
    return this.start_key;
  }

  public get_scanner_request setStart_key(blob start_key) {
    this.start_key = start_key;
    return this;
  }

  public void unsetStart_key() {
    this.start_key = null;
  }

  /** Returns true if field start_key is set (has been assigned a value) and false otherwise */
  public boolean isSetStart_key() {
    return this.start_key != null;
  }

  public void setStart_keyIsSet(boolean value) {
    if (!value) {
      this.start_key = null;
    }
  }

  public blob getStop_key() {
    return this.stop_key;
  }

  public get_scanner_request setStop_key(blob stop_key) {
    this.stop_key = stop_key;
    return this;
  }

  public void unsetStop_key() {
    this.stop_key = null;
  }

  /** Returns true if field stop_key is set (has been assigned a value) and false otherwise */
  public boolean isSetStop_key() {
    return this.stop_key != null;
  }

  public void setStop_keyIsSet(boolean value) {
    if (!value) {
      this.stop_key = null;
    }
  }

  public boolean isStart_inclusive() {
    return this.start_inclusive;
  }

  public get_scanner_request setStart_inclusive(boolean start_inclusive) {
    this.start_inclusive = start_inclusive;
    setStart_inclusiveIsSet(true);
    return this;
  }

  public void unsetStart_inclusive() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID);
  }

  /**
   * Returns true if field start_inclusive is set (has been assigned a value) and false otherwise
   */
  public boolean isSetStart_inclusive() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID);
  }

  public void setStart_inclusiveIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID, value);
  }

  public boolean isStop_inclusive() {
    return this.stop_inclusive;
  }

  public get_scanner_request setStop_inclusive(boolean stop_inclusive) {
    this.stop_inclusive = stop_inclusive;
    setStop_inclusiveIsSet(true);
    return this;
  }

  public void unsetStop_inclusive() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID);
  }

  /** Returns true if field stop_inclusive is set (has been assigned a value) and false otherwise */
  public boolean isSetStop_inclusive() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID);
  }

  public void setStop_inclusiveIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID, value);
  }

  public int getBatch_size() {
    return this.batch_size;
  }

  public get_scanner_request setBatch_size(int batch_size) {
    this.batch_size = batch_size;
    setBatch_sizeIsSet(true);
    return this;
  }

  public void unsetBatch_size() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID);
  }

  /** Returns true if field batch_size is set (has been assigned a value) and false otherwise */
  public boolean isSetBatch_size() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID);
  }

  public void setBatch_sizeIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID, value);
  }

  public boolean isNo_value() {
    return this.no_value;
  }

  public get_scanner_request setNo_value(boolean no_value) {
    this.no_value = no_value;
    setNo_valueIsSet(true);
    return this;
  }

  public void unsetNo_value() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NO_VALUE_ISSET_ID);
  }

  /** Returns true if field no_value is set (has been assigned a value) and false otherwise */
  public boolean isSetNo_value() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NO_VALUE_ISSET_ID);
  }

  public void setNo_valueIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NO_VALUE_ISSET_ID, value);
  }

  /** @see filter_type */
  public filter_type getHash_key_filter_type() {
    return this.hash_key_filter_type;
  }

  /** @see filter_type */
  public get_scanner_request setHash_key_filter_type(filter_type hash_key_filter_type) {
    this.hash_key_filter_type = hash_key_filter_type;
    return this;
  }

  public void unsetHash_key_filter_type() {
    this.hash_key_filter_type = null;
  }

  /**
   * Returns true if field hash_key_filter_type is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSetHash_key_filter_type() {
    return this.hash_key_filter_type != null;
  }

  public void setHash_key_filter_typeIsSet(boolean value) {
    if (!value) {
      this.hash_key_filter_type = null;
    }
  }

  public blob getHash_key_filter_pattern() {
    return this.hash_key_filter_pattern;
  }

  public get_scanner_request setHash_key_filter_pattern(blob hash_key_filter_pattern) {
    this.hash_key_filter_pattern = hash_key_filter_pattern;
    return this;
  }

  public void unsetHash_key_filter_pattern() {
    this.hash_key_filter_pattern = null;
  }

  /**
   * Returns true if field hash_key_filter_pattern is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSetHash_key_filter_pattern() {
    return this.hash_key_filter_pattern != null;
  }

  public void setHash_key_filter_patternIsSet(boolean value) {
    if (!value) {
      this.hash_key_filter_pattern = null;
    }
  }

  /** @see filter_type */
  public filter_type getSort_key_filter_type() {
    return this.sort_key_filter_type;
  }

  /** @see filter_type */
  public get_scanner_request setSort_key_filter_type(filter_type sort_key_filter_type) {
    this.sort_key_filter_type = sort_key_filter_type;
    return this;
  }

  public void unsetSort_key_filter_type() {
    this.sort_key_filter_type = null;
  }

  /**
   * Returns true if field sort_key_filter_type is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSetSort_key_filter_type() {
    return this.sort_key_filter_type != null;
  }

  public void setSort_key_filter_typeIsSet(boolean value) {
    if (!value) {
      this.sort_key_filter_type = null;
    }
  }

  public blob getSort_key_filter_pattern() {
    return this.sort_key_filter_pattern;
  }

  public get_scanner_request setSort_key_filter_pattern(blob sort_key_filter_pattern) {
    this.sort_key_filter_pattern = sort_key_filter_pattern;
    return this;
  }

  public void unsetSort_key_filter_pattern() {
    this.sort_key_filter_pattern = null;
  }

  /**
   * Returns true if field sort_key_filter_pattern is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSetSort_key_filter_pattern() {
    return this.sort_key_filter_pattern != null;
  }

  public void setSort_key_filter_patternIsSet(boolean value) {
    if (!value) {
      this.sort_key_filter_pattern = null;
    }
  }

  public boolean isNeed_check_hash() {
    return this.need_check_hash;
  }

  public get_scanner_request setNeed_check_hash(boolean need_check_hash) {
    this.need_check_hash = need_check_hash;
    setNeed_check_hashIsSet(true);
    return this;
  }

  public void unsetNeed_check_hash() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NEED_CHECK_HASH_ISSET_ID);
  }

  /**
   * Returns true if field need_check_hash is set (has been assigned a value) and false otherwise
   */
  public boolean isSetNeed_check_hash() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NEED_CHECK_HASH_ISSET_ID);
  }

  public void setNeed_check_hashIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NEED_CHECK_HASH_ISSET_ID, value);
  }

  public boolean isReturn_expire_ts() {
    return this.return_expire_ts;
  }

  public get_scanner_request setReturn_expire_ts(boolean return_expire_ts) {
    this.return_expire_ts = return_expire_ts;
    setReturn_expire_tsIsSet(true);
    return this;
  }

  public void unsetReturn_expire_ts() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RETURN_EXPIRE_TS_ISSET_ID);
  }

  /**
   * Returns true if field return_expire_ts is set (has been assigned a value) and false otherwise
   */
  public boolean isSetReturn_expire_ts() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RETURN_EXPIRE_TS_ISSET_ID);
  }

  public void setReturn_expire_tsIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(
            __isset_bitfield, __RETURN_EXPIRE_TS_ISSET_ID, value);
  }

  public boolean isFull_scan() {
    return this.full_scan;
  }

  public get_scanner_request setFull_scan(boolean full_scan) {
    this.full_scan = full_scan;
    setFull_scanIsSet(true);
    return this;
  }

  public void unsetFull_scan() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FULL_SCAN_ISSET_ID);
  }

  /** Returns true if field full_scan is set (has been assigned a value) and false otherwise */
  public boolean isSetFull_scan() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FULL_SCAN_ISSET_ID);
  }

  public void setFull_scanIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FULL_SCAN_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, java.lang.Object value) {
    switch (field) {
      case START_KEY:
        if (value == null) {
          unsetStart_key();
        } else {
          setStart_key((blob) value);
        }
        break;

      case STOP_KEY:
        if (value == null) {
          unsetStop_key();
        } else {
          setStop_key((blob) value);
        }
        break;

      case START_INCLUSIVE:
        if (value == null) {
          unsetStart_inclusive();
        } else {
          setStart_inclusive((java.lang.Boolean) value);
        }
        break;

      case STOP_INCLUSIVE:
        if (value == null) {
          unsetStop_inclusive();
        } else {
          setStop_inclusive((java.lang.Boolean) value);
        }
        break;

      case BATCH_SIZE:
        if (value == null) {
          unsetBatch_size();
        } else {
          setBatch_size((java.lang.Integer) value);
        }
        break;

      case NO_VALUE:
        if (value == null) {
          unsetNo_value();
        } else {
          setNo_value((java.lang.Boolean) value);
        }
        break;

      case HASH_KEY_FILTER_TYPE:
        if (value == null) {
          unsetHash_key_filter_type();
        } else {
          setHash_key_filter_type((filter_type) value);
        }
        break;

      case HASH_KEY_FILTER_PATTERN:
        if (value == null) {
          unsetHash_key_filter_pattern();
        } else {
          setHash_key_filter_pattern((blob) value);
        }
        break;

      case SORT_KEY_FILTER_TYPE:
        if (value == null) {
          unsetSort_key_filter_type();
        } else {
          setSort_key_filter_type((filter_type) value);
        }
        break;

      case SORT_KEY_FILTER_PATTERN:
        if (value == null) {
          unsetSort_key_filter_pattern();
        } else {
          setSort_key_filter_pattern((blob) value);
        }
        break;

      case NEED_CHECK_HASH:
        if (value == null) {
          unsetNeed_check_hash();
        } else {
          setNeed_check_hash((java.lang.Boolean) value);
        }
        break;

      case RETURN_EXPIRE_TS:
        if (value == null) {
          unsetReturn_expire_ts();
        } else {
          setReturn_expire_ts((java.lang.Boolean) value);
        }
        break;

      case FULL_SCAN:
        if (value == null) {
          unsetFull_scan();
        } else {
          setFull_scan((java.lang.Boolean) value);
        }
        break;
    }
  }

  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
      case START_KEY:
        return getStart_key();

      case STOP_KEY:
        return getStop_key();

      case START_INCLUSIVE:
        return isStart_inclusive();

      case STOP_INCLUSIVE:
        return isStop_inclusive();

      case BATCH_SIZE:
        return getBatch_size();

      case NO_VALUE:
        return isNo_value();

      case HASH_KEY_FILTER_TYPE:
        return getHash_key_filter_type();

      case HASH_KEY_FILTER_PATTERN:
        return getHash_key_filter_pattern();

      case SORT_KEY_FILTER_TYPE:
        return getSort_key_filter_type();

      case SORT_KEY_FILTER_PATTERN:
        return getSort_key_filter_pattern();

      case NEED_CHECK_HASH:
        return isNeed_check_hash();

      case RETURN_EXPIRE_TS:
        return isReturn_expire_ts();

      case FULL_SCAN:
        return isFull_scan();
    }
    throw new java.lang.IllegalStateException();
  }

  /**
   * Returns true if field corresponding to fieldID is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
      case START_KEY:
        return isSetStart_key();
      case STOP_KEY:
        return isSetStop_key();
      case START_INCLUSIVE:
        return isSetStart_inclusive();
      case STOP_INCLUSIVE:
        return isSetStop_inclusive();
      case BATCH_SIZE:
        return isSetBatch_size();
      case NO_VALUE:
        return isSetNo_value();
      case HASH_KEY_FILTER_TYPE:
        return isSetHash_key_filter_type();
      case HASH_KEY_FILTER_PATTERN:
        return isSetHash_key_filter_pattern();
      case SORT_KEY_FILTER_TYPE:
        return isSetSort_key_filter_type();
      case SORT_KEY_FILTER_PATTERN:
        return isSetSort_key_filter_pattern();
      case NEED_CHECK_HASH:
        return isSetNeed_check_hash();
      case RETURN_EXPIRE_TS:
        return isSetReturn_expire_ts();
      case FULL_SCAN:
        return isSetFull_scan();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that == null) return false;
    if (that instanceof get_scanner_request) return this.equals((get_scanner_request) that);
    return false;
  }

  public boolean equals(get_scanner_request that) {
    if (that == null) return false;
    if (this == that) return true;

    boolean this_present_start_key = true && this.isSetStart_key();
    boolean that_present_start_key = true && that.isSetStart_key();
    if (this_present_start_key || that_present_start_key) {
      if (!(this_present_start_key && that_present_start_key)) return false;
      if (!this.start_key.equals(that.start_key)) return false;
    }

    boolean this_present_stop_key = true && this.isSetStop_key();
    boolean that_present_stop_key = true && that.isSetStop_key();
    if (this_present_stop_key || that_present_stop_key) {
      if (!(this_present_stop_key && that_present_stop_key)) return false;
      if (!this.stop_key.equals(that.stop_key)) return false;
    }

    boolean this_present_start_inclusive = true;
    boolean that_present_start_inclusive = true;
    if (this_present_start_inclusive || that_present_start_inclusive) {
      if (!(this_present_start_inclusive && that_present_start_inclusive)) return false;
      if (this.start_inclusive != that.start_inclusive) return false;
    }

    boolean this_present_stop_inclusive = true;
    boolean that_present_stop_inclusive = true;
    if (this_present_stop_inclusive || that_present_stop_inclusive) {
      if (!(this_present_stop_inclusive && that_present_stop_inclusive)) return false;
      if (this.stop_inclusive != that.stop_inclusive) return false;
    }

    boolean this_present_batch_size = true;
    boolean that_present_batch_size = true;
    if (this_present_batch_size || that_present_batch_size) {
      if (!(this_present_batch_size && that_present_batch_size)) return false;
      if (this.batch_size != that.batch_size) return false;
    }

    boolean this_present_no_value = true;
    boolean that_present_no_value = true;
    if (this_present_no_value || that_present_no_value) {
      if (!(this_present_no_value && that_present_no_value)) return false;
      if (this.no_value != that.no_value) return false;
    }

    boolean this_present_hash_key_filter_type = true && this.isSetHash_key_filter_type();
    boolean that_present_hash_key_filter_type = true && that.isSetHash_key_filter_type();
    if (this_present_hash_key_filter_type || that_present_hash_key_filter_type) {
      if (!(this_present_hash_key_filter_type && that_present_hash_key_filter_type)) return false;
      if (!this.hash_key_filter_type.equals(that.hash_key_filter_type)) return false;
    }

    boolean this_present_hash_key_filter_pattern = true && this.isSetHash_key_filter_pattern();
    boolean that_present_hash_key_filter_pattern = true && that.isSetHash_key_filter_pattern();
    if (this_present_hash_key_filter_pattern || that_present_hash_key_filter_pattern) {
      if (!(this_present_hash_key_filter_pattern && that_present_hash_key_filter_pattern))
        return false;
      if (!this.hash_key_filter_pattern.equals(that.hash_key_filter_pattern)) return false;
    }

    boolean this_present_sort_key_filter_type = true && this.isSetSort_key_filter_type();
    boolean that_present_sort_key_filter_type = true && that.isSetSort_key_filter_type();
    if (this_present_sort_key_filter_type || that_present_sort_key_filter_type) {
      if (!(this_present_sort_key_filter_type && that_present_sort_key_filter_type)) return false;
      if (!this.sort_key_filter_type.equals(that.sort_key_filter_type)) return false;
    }

    boolean this_present_sort_key_filter_pattern = true && this.isSetSort_key_filter_pattern();
    boolean that_present_sort_key_filter_pattern = true && that.isSetSort_key_filter_pattern();
    if (this_present_sort_key_filter_pattern || that_present_sort_key_filter_pattern) {
      if (!(this_present_sort_key_filter_pattern && that_present_sort_key_filter_pattern))
        return false;
      if (!this.sort_key_filter_pattern.equals(that.sort_key_filter_pattern)) return false;
    }

    boolean this_present_need_check_hash = true && this.isSetNeed_check_hash();
    boolean that_present_need_check_hash = true && that.isSetNeed_check_hash();
    if (this_present_need_check_hash || that_present_need_check_hash) {
      if (!(this_present_need_check_hash && that_present_need_check_hash)) return false;
      if (this.need_check_hash != that.need_check_hash) return false;
    }

    boolean this_present_return_expire_ts = true && this.isSetReturn_expire_ts();
    boolean that_present_return_expire_ts = true && that.isSetReturn_expire_ts();
    if (this_present_return_expire_ts || that_present_return_expire_ts) {
      if (!(this_present_return_expire_ts && that_present_return_expire_ts)) return false;
      if (this.return_expire_ts != that.return_expire_ts) return false;
    }

    boolean this_present_full_scan = true && this.isSetFull_scan();
    boolean that_present_full_scan = true && that.isSetFull_scan();
    if (this_present_full_scan || that_present_full_scan) {
      if (!(this_present_full_scan && that_present_full_scan)) return false;
      if (this.full_scan != that.full_scan) return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetStart_key()) ? 131071 : 524287);
    if (isSetStart_key()) hashCode = hashCode * 8191 + start_key.hashCode();

    hashCode = hashCode * 8191 + ((isSetStop_key()) ? 131071 : 524287);
    if (isSetStop_key()) hashCode = hashCode * 8191 + stop_key.hashCode();

    hashCode = hashCode * 8191 + ((start_inclusive) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((stop_inclusive) ? 131071 : 524287);

    hashCode = hashCode * 8191 + batch_size;

    hashCode = hashCode * 8191 + ((no_value) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetHash_key_filter_type()) ? 131071 : 524287);
    if (isSetHash_key_filter_type()) hashCode = hashCode * 8191 + hash_key_filter_type.getValue();

    hashCode = hashCode * 8191 + ((isSetHash_key_filter_pattern()) ? 131071 : 524287);
    if (isSetHash_key_filter_pattern())
      hashCode = hashCode * 8191 + hash_key_filter_pattern.hashCode();

    hashCode = hashCode * 8191 + ((isSetSort_key_filter_type()) ? 131071 : 524287);
    if (isSetSort_key_filter_type()) hashCode = hashCode * 8191 + sort_key_filter_type.getValue();

    hashCode = hashCode * 8191 + ((isSetSort_key_filter_pattern()) ? 131071 : 524287);
    if (isSetSort_key_filter_pattern())
      hashCode = hashCode * 8191 + sort_key_filter_pattern.hashCode();

    hashCode = hashCode * 8191 + ((isSetNeed_check_hash()) ? 131071 : 524287);
    if (isSetNeed_check_hash()) hashCode = hashCode * 8191 + ((need_check_hash) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetReturn_expire_ts()) ? 131071 : 524287);
    if (isSetReturn_expire_ts())
      hashCode = hashCode * 8191 + ((return_expire_ts) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetFull_scan()) ? 131071 : 524287);
    if (isSetFull_scan()) hashCode = hashCode * 8191 + ((full_scan) ? 131071 : 524287);

    return hashCode;
  }

  @Override
  public int compareTo(get_scanner_request other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetStart_key()).compareTo(other.isSetStart_key());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStart_key()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_key, other.start_key);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetStop_key()).compareTo(other.isSetStop_key());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStop_key()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stop_key, other.stop_key);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetStart_inclusive()).compareTo(other.isSetStart_inclusive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStart_inclusive()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.start_inclusive, other.start_inclusive);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetStop_inclusive()).compareTo(other.isSetStop_inclusive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStop_inclusive()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.stop_inclusive, other.stop_inclusive);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetBatch_size()).compareTo(other.isSetBatch_size());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBatch_size()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batch_size, other.batch_size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetNo_value()).compareTo(other.isSetNo_value());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNo_value()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.no_value, other.no_value);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetHash_key_filter_type())
            .compareTo(other.isSetHash_key_filter_type());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHash_key_filter_type()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.hash_key_filter_type, other.hash_key_filter_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetHash_key_filter_pattern())
            .compareTo(other.isSetHash_key_filter_pattern());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHash_key_filter_pattern()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.hash_key_filter_pattern, other.hash_key_filter_pattern);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetSort_key_filter_type())
            .compareTo(other.isSetSort_key_filter_type());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSort_key_filter_type()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.sort_key_filter_type, other.sort_key_filter_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetSort_key_filter_pattern())
            .compareTo(other.isSetSort_key_filter_pattern());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSort_key_filter_pattern()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.sort_key_filter_pattern, other.sort_key_filter_pattern);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetNeed_check_hash()).compareTo(other.isSetNeed_check_hash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNeed_check_hash()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.need_check_hash, other.need_check_hash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetReturn_expire_ts()).compareTo(other.isSetReturn_expire_ts());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReturn_expire_ts()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.return_expire_ts, other.return_expire_ts);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetFull_scan()).compareTo(other.isSetFull_scan());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFull_scan()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.full_scan, other.full_scan);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot)
      throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("get_scanner_request(");
    boolean first = true;

    sb.append("start_key:");
    if (this.start_key == null) {
      sb.append("null");
    } else {
      sb.append(this.start_key);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("stop_key:");
    if (this.stop_key == null) {
      sb.append("null");
    } else {
      sb.append(this.stop_key);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("start_inclusive:");
    sb.append(this.start_inclusive);
    first = false;
    if (!first) sb.append(", ");
    sb.append("stop_inclusive:");
    sb.append(this.stop_inclusive);
    first = false;
    if (!first) sb.append(", ");
    sb.append("batch_size:");
    sb.append(this.batch_size);
    first = false;
    if (!first) sb.append(", ");
    sb.append("no_value:");
    sb.append(this.no_value);
    first = false;
    if (!first) sb.append(", ");
    sb.append("hash_key_filter_type:");
    if (this.hash_key_filter_type == null) {
      sb.append("null");
    } else {
      sb.append(this.hash_key_filter_type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("hash_key_filter_pattern:");
    if (this.hash_key_filter_pattern == null) {
      sb.append("null");
    } else {
      sb.append(this.hash_key_filter_pattern);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sort_key_filter_type:");
    if (this.sort_key_filter_type == null) {
      sb.append("null");
    } else {
      sb.append(this.sort_key_filter_type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sort_key_filter_pattern:");
    if (this.sort_key_filter_pattern == null) {
      sb.append("null");
    } else {
      sb.append(this.sort_key_filter_pattern);
    }
    first = false;
    if (isSetNeed_check_hash()) {
      if (!first) sb.append(", ");
      sb.append("need_check_hash:");
      sb.append(this.need_check_hash);
      first = false;
    }
    if (isSetReturn_expire_ts()) {
      if (!first) sb.append(", ");
      sb.append("return_expire_ts:");
      sb.append(this.return_expire_ts);
      first = false;
    }
    if (isSetFull_scan()) {
      if (!first) sb.append(", ");
      sb.append("full_scan:");
      sb.append(this.full_scan);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (start_key != null) {
      start_key.validate();
    }
    if (stop_key != null) {
      stop_key.validate();
    }
    if (hash_key_filter_pattern != null) {
      hash_key_filter_pattern.validate();
    }
    if (sort_key_filter_pattern != null) {
      sort_key_filter_pattern.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(
          new org.apache.thrift.protocol.TCompactProtocol(
              new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in)
      throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and
      // doesn't call the default constructor.
      __isset_bitfield = 0;
      read(
          new org.apache.thrift.protocol.TCompactProtocol(
              new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class get_scanner_requestStandardSchemeFactory
      implements org.apache.thrift.scheme.SchemeFactory {
    public get_scanner_requestStandardScheme getScheme() {
      return new get_scanner_requestStandardScheme();
    }
  }

  private static class get_scanner_requestStandardScheme
      extends org.apache.thrift.scheme.StandardScheme<get_scanner_request> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, get_scanner_request struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // START_KEY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.start_key = new blob();
              struct.start_key.read(iprot);
              struct.setStart_keyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // STOP_KEY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.stop_key = new blob();
              struct.stop_key.read(iprot);
              struct.setStop_keyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // START_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.start_inclusive = iprot.readBool();
              struct.setStart_inclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STOP_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.stop_inclusive = iprot.readBool();
              struct.setStop_inclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // BATCH_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.batch_size = iprot.readI32();
              struct.setBatch_sizeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // NO_VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.no_value = iprot.readBool();
              struct.setNo_valueIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // HASH_KEY_FILTER_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.hash_key_filter_type = filter_type.findByValue(iprot.readI32());
              struct.setHash_key_filter_typeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // HASH_KEY_FILTER_PATTERN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.hash_key_filter_pattern = new blob();
              struct.hash_key_filter_pattern.read(iprot);
              struct.setHash_key_filter_patternIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // SORT_KEY_FILTER_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32());
              struct.setSort_key_filter_typeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // SORT_KEY_FILTER_PATTERN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.sort_key_filter_pattern = new blob();
              struct.sort_key_filter_pattern.read(iprot);
              struct.setSort_key_filter_patternIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // NEED_CHECK_HASH
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.need_check_hash = iprot.readBool();
              struct.setNeed_check_hashIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // RETURN_EXPIRE_TS
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.return_expire_ts = iprot.readBool();
              struct.setReturn_expire_tsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // FULL_SCAN
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.full_scan = iprot.readBool();
              struct.setFull_scanIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, get_scanner_request struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.start_key != null) {
        oprot.writeFieldBegin(START_KEY_FIELD_DESC);
        struct.start_key.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.stop_key != null) {
        oprot.writeFieldBegin(STOP_KEY_FIELD_DESC);
        struct.stop_key.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(START_INCLUSIVE_FIELD_DESC);
      oprot.writeBool(struct.start_inclusive);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(STOP_INCLUSIVE_FIELD_DESC);
      oprot.writeBool(struct.stop_inclusive);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BATCH_SIZE_FIELD_DESC);
      oprot.writeI32(struct.batch_size);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(NO_VALUE_FIELD_DESC);
      oprot.writeBool(struct.no_value);
      oprot.writeFieldEnd();
      if (struct.hash_key_filter_type != null) {
        oprot.writeFieldBegin(HASH_KEY_FILTER_TYPE_FIELD_DESC);
        oprot.writeI32(struct.hash_key_filter_type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.hash_key_filter_pattern != null) {
        oprot.writeFieldBegin(HASH_KEY_FILTER_PATTERN_FIELD_DESC);
        struct.hash_key_filter_pattern.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.sort_key_filter_type != null) {
        oprot.writeFieldBegin(SORT_KEY_FILTER_TYPE_FIELD_DESC);
        oprot.writeI32(struct.sort_key_filter_type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.sort_key_filter_pattern != null) {
        oprot.writeFieldBegin(SORT_KEY_FILTER_PATTERN_FIELD_DESC);
        struct.sort_key_filter_pattern.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.isSetNeed_check_hash()) {
        oprot.writeFieldBegin(NEED_CHECK_HASH_FIELD_DESC);
        oprot.writeBool(struct.need_check_hash);
        oprot.writeFieldEnd();
      }
      if (struct.isSetReturn_expire_ts()) {
        oprot.writeFieldBegin(RETURN_EXPIRE_TS_FIELD_DESC);
        oprot.writeBool(struct.return_expire_ts);
        oprot.writeFieldEnd();
      }
      if (struct.isSetFull_scan()) {
        oprot.writeFieldBegin(FULL_SCAN_FIELD_DESC);
        oprot.writeBool(struct.full_scan);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
  }

  private static class get_scanner_requestTupleSchemeFactory
      implements org.apache.thrift.scheme.SchemeFactory {
    public get_scanner_requestTupleScheme getScheme() {
      return new get_scanner_requestTupleScheme();
    }
  }

  private static class get_scanner_requestTupleScheme
      extends org.apache.thrift.scheme.TupleScheme<get_scanner_request> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, get_scanner_request struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot =
          (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetStart_key()) {
        optionals.set(0);
      }
      if (struct.isSetStop_key()) {
        optionals.set(1);
      }
      if (struct.isSetStart_inclusive()) {
        optionals.set(2);
      }
      if (struct.isSetStop_inclusive()) {
        optionals.set(3);
      }
      if (struct.isSetBatch_size()) {
        optionals.set(4);
      }
      if (struct.isSetNo_value()) {
        optionals.set(5);
      }
      if (struct.isSetHash_key_filter_type()) {
        optionals.set(6);
      }
      if (struct.isSetHash_key_filter_pattern()) {
        optionals.set(7);
      }
      if (struct.isSetSort_key_filter_type()) {
        optionals.set(8);
      }
      if (struct.isSetSort_key_filter_pattern()) {
        optionals.set(9);
      }
      if (struct.isSetNeed_check_hash()) {
        optionals.set(10);
      }
      if (struct.isSetReturn_expire_ts()) {
        optionals.set(11);
      }
      if (struct.isSetFull_scan()) {
        optionals.set(12);
      }
      oprot.writeBitSet(optionals, 13);
      if (struct.isSetStart_key()) {
        struct.start_key.write(oprot);
      }
      if (struct.isSetStop_key()) {
        struct.stop_key.write(oprot);
      }
      if (struct.isSetStart_inclusive()) {
        oprot.writeBool(struct.start_inclusive);
      }
      if (struct.isSetStop_inclusive()) {
        oprot.writeBool(struct.stop_inclusive);
      }
      if (struct.isSetBatch_size()) {
        oprot.writeI32(struct.batch_size);
      }
      if (struct.isSetNo_value()) {
        oprot.writeBool(struct.no_value);
      }
      if (struct.isSetHash_key_filter_type()) {
        oprot.writeI32(struct.hash_key_filter_type.getValue());
      }
      if (struct.isSetHash_key_filter_pattern()) {
        struct.hash_key_filter_pattern.write(oprot);
      }
      if (struct.isSetSort_key_filter_type()) {
        oprot.writeI32(struct.sort_key_filter_type.getValue());
      }
      if (struct.isSetSort_key_filter_pattern()) {
        struct.sort_key_filter_pattern.write(oprot);
      }
      if (struct.isSetNeed_check_hash()) {
        oprot.writeBool(struct.need_check_hash);
      }
      if (struct.isSetReturn_expire_ts()) {
        oprot.writeBool(struct.return_expire_ts);
      }
      if (struct.isSetFull_scan()) {
        oprot.writeBool(struct.full_scan);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, get_scanner_request struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot =
          (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(13);
      if (incoming.get(0)) {
        struct.start_key = new blob();
        struct.start_key.read(iprot);
        struct.setStart_keyIsSet(true);
      }
      if (incoming.get(1)) {
        struct.stop_key = new blob();
        struct.stop_key.read(iprot);
        struct.setStop_keyIsSet(true);
      }
      if (incoming.get(2)) {
        struct.start_inclusive = iprot.readBool();
        struct.setStart_inclusiveIsSet(true);
      }
      if (incoming.get(3)) {
        struct.stop_inclusive = iprot.readBool();
        struct.setStop_inclusiveIsSet(true);
      }
      if (incoming.get(4)) {
        struct.batch_size = iprot.readI32();
        struct.setBatch_sizeIsSet(true);
      }
      if (incoming.get(5)) {
        struct.no_value = iprot.readBool();
        struct.setNo_valueIsSet(true);
      }
      if (incoming.get(6)) {
        struct.hash_key_filter_type = filter_type.findByValue(iprot.readI32());
        struct.setHash_key_filter_typeIsSet(true);
      }
      if (incoming.get(7)) {
        struct.hash_key_filter_pattern = new blob();
        struct.hash_key_filter_pattern.read(iprot);
        struct.setHash_key_filter_patternIsSet(true);
      }
      if (incoming.get(8)) {
        struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32());
        struct.setSort_key_filter_typeIsSet(true);
      }
      if (incoming.get(9)) {
        struct.sort_key_filter_pattern = new blob();
        struct.sort_key_filter_pattern.read(iprot);
        struct.setSort_key_filter_patternIsSet(true);
      }
      if (incoming.get(10)) {
        struct.need_check_hash = iprot.readBool();
        struct.setNeed_check_hashIsSet(true);
      }
      if (incoming.get(11)) {
        struct.return_expire_ts = iprot.readBool();
        struct.setReturn_expire_tsIsSet(true);
      }
      if (incoming.get(12)) {
        struct.full_scan = iprot.readBool();
        struct.setFull_scanIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(
      org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme())
            ? STANDARD_SCHEME_FACTORY
            : TUPLE_SCHEME_FACTORY)
        .getScheme();
  }
}
